<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/10/12 13:35
 * Desc:
 */
class Request_Api_V2_Outdoor extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function query()
    {
        $this->rules = [
            ['page', ['not_empty', 'digit', $this->rule_min(1)]],
            ['pagesize', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function nav()
    {
        $this->rules = [
            ['row', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function join_member()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['date', ['not_empty', $this->rule_date_format('Y-m-d')]],
        ];

        return $this;
    }

    public function get_suit()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['date', ['not_empty', $this->rule_date_format('Y-m-d')]],
            ['suit_id', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function add_order()
    {
        $this->validation->rule('mid',array('Rule_Member','need_member'));
        $this->rules = [
            ['product_id', ['not_empty', 'digit']],
            ['suit_id', ['not_empty', 'digit']],
            ['ding_num', ['digit']],
            ['childnum', ['digit']],
            ['use_date', ['not_empty',  $this->rule_date_format('Y-m-d')]],
            ['source', ['not_empty']],
            ['link_info', ['not_empty']]
        ];

        return $this;
    }

    public function contract()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit', $this->rule_min(1)]],
        ];

        return $this;
    }

}